Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[oci_generative_ai] Option to pass auth_file_location #29481

Merged
merged 1 commit into from
Feb 4, 2025

Conversation

ashutoshSce
Copy link
Contributor

@ashutoshSce ashutoshSce commented Jan 29, 2025

PR title: "community: Option to pass auth_file_location for oci_generative_ai"

Description: Option to pass auth_file_location, to overwrite config file default location "~/.oci/config" where profile name configs present. This is not fixing any issues. Just added optional parameter called "auth_file_location", which internally supported by any OCI client including GenerativeAiInferenceClient.

Copy link

vercel bot commented Jan 29, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
langchain ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 29, 2025 9:34pm

@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. community Related to langchain-community labels Jan 29, 2025
@ashutoshSce ashutoshSce force-pushed the master branch 2 times, most recently from ea8bba9 to 6520490 Compare January 29, 2025 21:08
Copy link
Collaborator

@ccurme ccurme left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@@ -66,6 +69,11 @@ class OCIGenAIEmbeddings(BaseModel, Embeddings):
If not specified , DEFAULT will be used
"""

auth_file_location: Optional[str] = "~/.oci/config"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is Optional[str], what is the difference between this default and setting a default of None?

Copy link
Contributor Author

@ashutoshSce ashutoshSce Feb 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @ccurme for response.

This is already there in this file
auth_profile: Optional[str] = "DEFAULT"

We have added this new one, so that we can give option to overwrite default config file location as well, same as profile name.
auth_file_location: Optional[str] = "~/.oci/config"

Later on, in this same file we have used auth_profile and auth_file_location to load configs. We can't pass their values as None, because of the definition of function. It will throw exception.

def from_file(file_location=DEFAULT_LOCATION, profile_name=DEFAULT_PROFILE):

https://docs.oracle.com/en-us/iaas/tools/python/2.143.1/configuration.html

@ccurme ccurme self-assigned this Feb 2, 2025
@dosubot dosubot bot added the lgtm PR looks good. Use to confirm that a PR is ready for merging. label Feb 4, 2025
@ccurme ccurme merged commit 65b404a into langchain-ai:master Feb 4, 2025
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community Related to langchain-community lgtm PR looks good. Use to confirm that a PR is ready for merging. size:M This PR changes 30-99 lines, ignoring generated files.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants